#!/usr/bin/env python

import urllib, sys

url = sys.argv[1]
#outfile = sys.argv[2]

page = urllib.urlopen(url).read()

linkStart = '<a href="http://rapidshare.com'
offsetStart = 9
linkEnd = '"'
offsetEnd = -9

links = []

startPos = page.find(linkStart)
endPos = page[ startPos + len(linkStart): ].find(linkEnd)

while startPos > 0:
	links.append( page[ startPos + offsetStart:startPos + offsetStart + len(linkStart) + endPos + offsetEnd ] )
	page = page [ startPos + offsetStart + len(linkStart) + endPos + offsetEnd: ]
	startPos = page.find(linkStart)
	endPos = page[ startPos + len(linkStart): ].find(linkEnd)


#print links

#outtext = ""
for l in links:
	#outtext += l + "\n"
	print l



#f = open(outfile, 'w')
#f.write(outtext)
#f.close
